using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;

public class TapToAdd : MonoBehaviour, IPointerClickHandler, IEventSystemHandler
{
	private int tapCount;

	public int tapToAdd = 5;

	public GameObject[] addObjects;

	public UnityEvent onFire;

	public void OnPointerClick(PointerEventData eventData)
	{
		tapCount++;
		if (tapCount == tapToAdd)
		{
			GameObject[] array = addObjects;
			for (int i = 0; i < array.Length; i++)
			{
				Object.Instantiate(array[i]);
			}
			onFire.Invoke();
		}
	}
}
